#!/bin/bash

# Fortran compile wrapper-script for 'compile.sh'.
# See that script for syntax and more info.

DEST="$1" ; shift
MAINSOURCE="$1"

# -x f95:       Explicitly set compile language to Fortran95 (no object
#               files or other languages autodetected by extension)
# -Wall:        Report all warnings
# -02:          Level 2 optimizations (default for speed)
# -cpp:         Run C preprocessor
gfortran -x f95 -Wall -O2 -cpp -DONLINE_JUDGE -o "$DEST" "$@"
exitcode=$?

# clean created files:
rm -f "$DEST.o"

exit $exitcode